using Runtime.Common.Utility;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.SceneManagement;

namespace Runtime.Module.GameGraphic.Editor
{
    public class GameSceneScriptSet<T> : GameScriptSet<T> where T : Component
    {
        public GameSceneScriptSet()
        {
        }

        public GameSceneScriptSet(
            SerializedObject serializedObject, T target, string nodeInfoCtrlName) :
            base(serializedObject, target, nodeInfoCtrlName)
        {
        }

        public override EntityNode GetControl()
        {
            Scene scene = SceneManager.GetActiveScene();
            SceneOfEntityNode control = SceneObjcet.GetComponentInAll<SceneOfEntityNode>(scene, out _);
            return control;
        }
    }
}